#write kernel image and filesystem to nand flash

send	setenv ethaddr 00:11:f7:06:14:46
expect {
    "DM355 IPNC # "
}
send setenv ipaddr 192.168.5.33
expect {
    "DM355 IPNC # "
}
send setenv serverip 192.168.5.30
expect {
    "DM355 IPNC # "
}

send setenv bootargs mem=80M console=ttyS1,115200n8 root=/dev/ram0 rw initrd=0x82000000,8M ip=192.168.5.101:192.168.5.100:192.168.5.1:255.255.255.0:IST:eth0:off eth=00:0C:0C:A0:00:24 v4l2_video_capture=:device=MT9P031
expect {
    "DM355 IPNC # "
}
#erase 15M from 0x200000 where burn kernel
send nand erase 0x200000 0xc00000
expect {
    "DM355 IPNC # "
}
#clearn memory ... I don't think we need do this ram is not nand flash!!!!
send nand read 0x82000000 0x200000 0xc00000
expect {
    "DM355 IPNC # "
}
send tftpboot 0x82000000 flash_image
expect {
    "DM355 IPNC # "
}
send nand write 0x82000000 0x200000 0xc00000
expect {
    "DM355 IPNC # "
}
send setenv bootcmd nand read 0x82000000 0x500000 0x800000;nboot 0x80700000 0 0x200000;bootm 0x80700000
expect {
    "DM355 IPNC # "
}
send boot
expect {
}
timeout 1
exit 0
